package cn.su.service.impl;

import cn.su.dao.billDao;
import cn.su.dao.impl.billDaoimpl;
import cn.su.dao.impl.providerDaoimpl;
import cn.su.dao.providerDao;
import cn.su.pojo.bill;
import cn.su.pojo.provider;
import cn.su.service.billlistService;

import java.util.LinkedList;
import java.util.List;

public class billlistServiceimpl implements billlistService {
    @Override
    public List<bill> billList() {
        billDao billdao=new billDaoimpl();
        List<bill> bills = billdao.billList();
        return bills;
    }
    @Override
    public List<provider> providerandbill_List() {
        billDao billdao=new billDaoimpl();
        List<provider> providers = billdao.providerandbill_List();
        return providers;
    }

    @Override
    public List<bill> billSearch(String ProductName, String ProviderName, String IsPayment) {
        billDao billdao = new billDaoimpl();
        List<bill> bills = billdao.billSearch(ProductName, ProviderName, IsPayment);
        return bills;
    }

    @Override
    public int bill_add(bill bill) {
        billDao billdao = new billDaoimpl();
        int n=billdao.bill_add(bill);
         return  n;
    }

    @Override
    public int bill_delete(int id) {
        billDao billdao = new billDaoimpl();
        int i = billdao.bill_delete(id);
        return i;
    }

    @Override
    public bill bill_chakan(int id) {
        billDao billDao=new billDaoimpl();
        bill bill = billDao.bill_chakan(id);
        return bill;
    }

    @Override
    public int bill_update(int id, bill bill) {
        billDao billDao=new billDaoimpl();
        int i = billDao.bill_update(id, bill);
        return i;
    }
}
